from flask import Flask
from exts import db
import configs
from view.View import LoginView,RegisterView,IndexView,LogOutView

app = Flask(__name__)
# 加载配置文件
app.config.from_object(configs)
app.jinja_env.auto_reload = True
app.config['TEMPLATES_AUTO_RELOAD'] = True
# db绑定app
db.init_app(app)
app.add_url_rule('/login/',view_func=LoginView.as_view('login'))#登录
app.add_url_rule('/register/',view_func=RegisterView.as_view('register'))#注册
app.add_url_rule('/index/',view_func=IndexView.as_view('index'))#首页
app.add_url_rule('/logout/',view_func=LoginView.as_view('logout'))#注销


if __name__ == '__main__':
    app.run()
